<?
include '../Module/SystemModule.php';
$sysModule=new SystemModule();
$paras=$sysModule->gets();
?>
<div class="group-box">
    <table class="dt w100">
        <tr>
            <th colspan="3">Chiều Cao Các Trang</th>
        </tr>
        <tr>
            <td>1</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_about">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["about_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>Giới Thiệu</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_process">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["process_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>Qui Trình</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>3</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_gallery">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["gallery_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>Gallery</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>4</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_new">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["new_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>Tin Tức</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>5</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_product">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["product_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>Sản Phẩm</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>3</td>
            <td>
                <div class="_input-label" type="select">
                    <div class="input" type="select">
                        <div class="select">
                            <select id="id_setting_more">
                                <?
                                $op0=$op1=$op2=$op3=$op4=null;
                                switch ($paras["more_height"]){
                                    case "height:320px;overflow-y: auto;overflow-x: hidden;":
                                        $op0="selected=1";
                                        break;
                                    case "height:480px;overflow-y: auto;overflow-x: hidden;":
                                        $op1="selected=1";
                                        break;
                                    case "height:720px;overflow-y: auto;overflow-x: hidden;":
                                        $op2="selected=1";
                                        break;
                                    case "height:960px;overflow-y: auto;overflow-x: hidden;":
                                        $op3="selected=1";
                                        break;
                                    default :
                                        $op4="selected=1";
                                }
                                ?>
                                <option <?=$op0?> value="height:320px;overflow-y: auto;overflow-x: hidden;">0.7x(320px)</option>
                                <option <?=$op1?> value="height:480px;overflow-y: auto;overflow-x: hidden;">1x(480px)</option>
                                <option <?=$op2?> value="height:720px;overflow-y: auto;overflow-x: hidden;">1.5x(720px)</option>
                                <option <?=$op3?> value="height:960px;overflow-y: auto;overflow-x: hidden;">2x(960px)</option>
                                <option <?=$op4?> value="height:auto;">Auto height</option>
                            </select>
                        </div>
                        <div class="label"><label>More or Detail</label></div>
                    </div>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <th colspan="3">Logo và Banner</th>
        </tr>
        <tr>
            <td>0</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_background" placeholder="" value="<?=$paras["background"]?>"/>
                        <div class="label"><label>Background</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_background' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>1</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_logo" placeholder="" value="<?=$paras["logo"]?>"/>
                        <div class="label"><label>Logo</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_logo' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/action_check.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_right_banner" placeholder="" value="<?=$paras["right_banner"]?>"/>
                        <div class="label"><label>Banner Phải</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_right_banner' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_banner1" placeholder="" value="<?=$paras["banner1"]?>"/>
                        <div class="label"><label>Banner 1</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_banner1' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_banner2" placeholder="" value="<?=$paras["banner2"]?>"/>
                        <div class="label"><label>Banner 2</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_banner2' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_banner3" placeholder="" value="<?=$paras["banner3"]?>"/>
                        <div class="label"><label>Banner 3</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_banner3' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td style="position: relative">
                <div class="_input-label">
                    <div class="input">
                        <input type="text" id="txt_setting_banner4" placeholder="" value="<?=$paras["banner4"]?>"/>
                        <div class="label"><label>Banner 4</label></div>
                    </div>
                </div>
                <div class="icon16 hover50 tooltip" style="position: absolute;top:16px;right:12px;cursor: pointer"
                    onclick="BrowseServer( 'Images:/', 'txt_setting_banner4' );"
                    title="Chọn hình ảnh"
                    >
                    <img src="./images/icon/16/folder_explore.png"/>
                </div>
            </td>
            <td>
                <div class="icon16 hover50 tooltip" title="Lưu">
                    <img src="./images/icon/16/save.png"/>
                </div>
            </td>
        </tr>
    </table>
    <div class="mybutton icon spaceright tooltip"
         title="Reset"
         onclick="resetsetting();">
        <div><img src="./images/icon/16/undo_red.png"/><span>Reset</span></div>
    </div>
    <div class="mybutton icon spaceright tooltip"
         title="Lưu"
         onclick="changesetting();">
        <div><img src="./images/icon/16/save.png"/><span>Lưu</span></div>
    </div>
    <div class="clear"></div>
</div>
<script>
    function resetsetting(){
        $(".group-box select").val("height:auto;");
        $("#txt_setting_background").val("Product/images/BackGround/px1.jpg");
        $("#txt_setting_logo").val("Product/images/png/logo_2.png");
        $("#txt_setting_right_banner").val("Product/images/Banner/attachment.png");
        changesetting();
    }
        function changesetting(){
            
            var surl="./Controller/";
            
            var sdata={
                    "controller":"SystemController",
                    "action":"changesetting",
                    "paras":JSON.stringify([
                        {"name":"about_height"      ,"value":$("#id_setting_about").val()           },
                        {"name":"process_height"    ,"value":$("#id_setting_process").val()         },
                        {"name":"gallery_height"    ,"value":$("#id_setting_gallery").val()         },
                        {"name":"new_height"        ,"value":$("#id_setting_new").val()             },
                        {"name":"product_height"    ,"value":$("#id_setting_product").val()         },
                        {"name":"more_height"       ,"value":$("#id_setting_more").val()            },
                        {"name":"background"        ,"value":$("#txt_setting_background").val()     },
                        {"name":"logo"              ,"value":$("#txt_setting_logo").val()           },
                        {"name":"right_banner"      ,"value":$("#txt_setting_right_banner").val()   },
                        {"name":"banner1"           ,"value":$("#txt_setting_banner1").val()        },
                        {"name":"banner2"           ,"value":$('#txt_setting_banner2').val()        },
                        {"name":"banner3"           ,"value":$('#txt_setting_banner3').val()        },
                        {"name":"banner4"           ,"value":$('#txt_setting_banner4').val()        }
                    ])
            };
            jQuery.ajax({
                    type:"POST", 
                    data:sdata, 
                    dataType:"text", 
                    url:surl, 
                    success: function (data){
                        if(data=="true"){
                            setTimeout(function() {
                            },3000);
                            showmsg("Thành Công.",2000);
                        }else{
                            showmsg(data);
                            
                        }

                    },
                    error: function (xhr, ajaxOptions, thrownError){
                            showerrorbox(null,"<b>Status</b>:"+xhr.status+"<br/><b>ThrownError</b>:"+thrownError);
                            
                    }
            });

        }
</script>